package com.xjrh.traintravel.collector.common;

/**
 * 字符串操作类
 *
 * @author snps
 * @create 2022-01-24 16:11
 * @describe
 **/
public class StringUtil {

    public static final String STRING_EMPTY = "";

    public static final String STRING_NULL = "null";


    /**
     * 判断字符串是否为空
     * @param string 字符串
     * @return (true-空, false-非空)
     */
    public static boolean isEmpty(String string) {
        if (string == null || string.trim().equals(STRING_EMPTY) || string.trim().toLowerCase().equals(STRING_NULL)) {
            return true;
        }

        return false;
    }

    /**
     * 判断字符串是否非空
     * @param string 字符串
     * @return (true-非空, false-空)
     */
    public static boolean isNotEmpty(String string) {
        return !isEmpty(string);
    }


}